From: Kim F. Storm Date: Fri, 30 Jul 2004 12:05:08 +0000 (+0000) Subject: (Fformat): Allocated extra (dummy) element in info. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~21516 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=879e6004109c7d3004dec80a7ce6508eec7cfbee;p=emacs.git (Fformat): Allocated extra (dummy) element in info. --- diff --git a/src/editfns.c b/src/editfns.c index a506c5f4fc8..88a0e63118f 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3254,6 +3254,7 @@ usage: (format STRING &rest OBJECTS) */) /* Piggyback on this loop to initialize precision[N]. */ precision[n] = -1; } + precision[nargs] = -1; CHECK_STRING (args[0]); /* We may have to change "%S" to "%s". */ @@ -3277,11 +3278,11 @@ usage: (format STRING &rest OBJECTS) */) /* Allocate the info and discarded tables. */ { - int nbytes = nargs * sizeof *info; + int nbytes = (nargs+1) * sizeof *info; int i; info = (struct info *) alloca (nbytes); bzero (info, nbytes); - for (i = 0; i < nargs; i++) + for (i = 0; i <= nargs; i++) info[i].start = -1; discarded = (char *) alloca (SBYTES (args[0])); bzero (discarded, SBYTES (args[0]));